/**
 * 项目类型枚举 (ProjectType)
 */
export enum ProjectType {
  FRONTEND = 'frontend', // 前端项目
  BACKEND = 'backend'    // 后端项目
}

/**
 * 项目状态枚举 (ProjectStatus)
 */
export enum ProjectStatus {
  ACTIVE = 'active',          // 活跃状态
  INACTIVE = 'inactive',      // 非活跃状态
  DEPRECATED = 'deprecated',  // 已废弃
  DEVELOPMENT = 'development' // 开发中
}

/**
 * 部署状态枚举 (DeployStatus)
 */
export enum DeployStatus {
  PENDING = 'pending',         // 等待部署
  IN_PROGRESS = 'in_progress', // 部署中
  SUCCESS = 'success',        // 部署成功
  FAILED = 'failed'           // 部署失败
}

/**
 * 项目版本实体
 */
export interface ProjectVersion {
  id: number
  version: string
  md5_hash: string
  notes?: string
  is_current: boolean
  created_at: string
}

/**
 * 项目配置模板
 */
export interface ProjectConfig {
  id?: number
  project_id?: number
  key: string
  value: string
  description?: string
  file_path?: string
  created_at?: string
  updated_at?: string
}

/**
 * 项目实体
 */
export interface Project {
  id: number
  name: string
  description?: string
  type: ProjectType
  status: ProjectStatus
  git_url?: string
  base_path?: string
  config_template_id?: number
  config_template?: string | ProjectConfig
  startup_script?: string
  created_at: string
  updated_at: string
  versions?: ProjectVersion[]
}

/**
 * 项目创建请求
 */
export interface ProjectCreateRequest {
  name: string
  description?: string
  type: ProjectType
  status?: ProjectStatus
  git_url?: string
  config_template_id?: number
  startup_script?: string
}

/**
 * 项目更新请求
 */
export interface ProjectUpdateRequest {
  id: number
  name?: string
  description?: string
  status?: ProjectStatus
  git_url?: string
  base_path?: string
  config_template_id?: number
  startup_script?: string
  config_template?: ProjectConfig
}

/**
 * 项目版本上传请求
 */
export interface ProjectVersionUploadRequest {
  project_id: number
  version: string
  notes?: string
  config_json?: string
  file: File
}

/**
 * 项目脚本
 */
export interface ProjectScript {
  id?: number
  project_id: number
  content: string
  created_at?: string
  updated_at?: string
}
